package com.house.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.house.entity.Role;
import org.apache.ibatis.annotations.*;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select " +
            "role_id, role_name, description, create_user, update_user " +
            "from role where role_id = #{roleId}")
    Role selectRoleByRoleId(int roleId);
    @Select("select menu_ids from role where role_id = #{roleId}")
    Role selectRoleMenuIdsByRoleId(int roleId);
    @Delete("delete from role where role_id = #{roleId}")
    int delete(int roomId);

    @Update("update role set menu_ids = #{menuIds} where role_id = #{role_id}")
    int updateRoleBindMenus(String menuIds, int roleId);
}
